' Estimated using Eviews 7 or 8.
' Estimation code for model A with m_0 = 0
' Likelihood optimized using Marquardt optimization
' Note that compared to the results in the paper, these estimates are based on promotional dummies instead of (proprietary) promotional costs.
' Note that starting values are important and that to obtain the maximum likelihood one needs to experiment with different starting values


' Set starting values
@param c(1) 1000 c(2) 1000 c(5) .1


Xb 	=  cc(1) + cc(2) * prom_sum + cc(5) * attendance(-1) + cc(15) * Season11 + cc(16) * season12 + cc(17) * opening11 + cc(18) * opening12 + cc(23) * day5 + cc(24) * day6 + cc(27) * day7 + cc(28) * july + cc(29) * august + cc(30) * sep + cc(31) * perf_wp + cc(32) * opp_distance + cc(50) * temp +  cc(60) * nattv + cc(80) * Control_all - cc(5) * ( cc(15) * Season11(-1) + cc(16) * season12(-1) + cc(17) * opening11(-1) + cc(18) * opening12(-1) + cc(23) * day5(-1) + cc(24) * day6(-1) + cc(27) * day7(-1) + cc(28) * july(-1) + cc(29) * august(-1) + cc(30) * sep(-1) + cc(31) * perf_wp(-1) + cc(32) * opp_distance(-1) + cc(50) * temp(-1) + cc(60) * nattv(-1) + cc(80) * Control_all(-1) ) 

res	= Attendance - Xb
resma	= res + ( cc(5)+cc(8) ) * resma(-1)
stddev	= cc(11)

logl1	= log(@dnorm(resma/stddev)) - log(stddev^2)/2

@logl logl1


































